/**
 * sequelize初始化
 */

import { Sequelize } from 'sequelize';
import initModels from './models/init-models';
import dbconfig from './config';

const sequelize = new Sequelize(dbconfig.database, dbconfig.user, dbconfig.password, {
  host: dbconfig.host,
  port: dbconfig.port,
  dialect: 'mysql',
  define: {
    freezeTableName: true,
    timestamps: false,
    paranoid: false
  }
});

export default initModels(sequelize);
export { sequelize };
